class Person implements Cloneable{
    public String name;
    public int age;
    public Money money = new Money();

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }


    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
class Money {
    public double m = 9.9;

}


public class Main {
    public static void main(String[] args) throws CloneNotSupportedException {
        Person person = new Person("张三",18);
        Person person1 = (Person)person.clone();//clone
        System.out.println(person.money.m);
        System.out.println(person1.money.m);
        System.out.println("============");

    }
}
